/*
 * Created by JFormDesigner on Thu Oct 27 20:22:26 CST 2022
 */

package com.liyu.ui;

import javax.swing.*;
import javax.swing.table.DefaultTableModel;
import java.awt.*;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

/**
 * @author destiny
 */
public class MainFram extends JFrame {
    // JFormDesigner - Variables declaration - DO NOT MODIFY  //GEN-BEGIN:variables  @formatter:off
    private JPanel panel2;
    private JPanel selectPanel;
    private JLabel label10;
    private JLabel selectLabel;
    private JTextField selectTextField;
    private JComboBox<String> selectComboBox;
    private JButton selectButton;
    private JLabel label9;
    private JLabel label8;
    private JLabel label1;
    private JLabel selectTimeLabel;
    private JComboBox<String> selectTimeComboBox;
    private JLabel label11;
    private JLabel selectPriceLabel;
    private JTextField minPriceTextField;
    private JLabel label7;
    private JTextField maxPriceTextField;
    private JButton resetButton;
    private JScrollPane goodInfoScrollPane;
    private JTable goodInfoTable;
    private JMenuBar menuBar;
    private JMenu selfMenu;
    private JMenuItem menuItem1;
    private JMenuItem menuItem2;
    private JMenuItem menuItem6;
    private JMenu helpMenu;
    private JMenuItem menuItem3;
    private JMenuItem menuItem4;
    private JMenu masterMenu;
    private JMenuItem menuItem5;
    private JMenuItem menuItem7;

    public MainFram() {
        initComponents();
    }

    public static void start() {
        MainFram frame = new MainFram();
        frame.setVisible(true);
    }

    private void table1MouseClicked(MouseEvent e) {
        // TODO add your code here
    }

    private void initComponents() {
        // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents  @formatter:off
        panel2 = new JPanel();
        selectPanel = new JPanel();
        label10 = new JLabel();
        selectLabel = new JLabel();
        selectTextField = new JTextField();
        selectComboBox = new JComboBox<>();
        selectButton = new JButton();
        label9 = new JLabel();
        label8 = new JLabel();
        label1 = new JLabel();
        selectTimeLabel = new JLabel();
        selectTimeComboBox = new JComboBox<>();
        label11 = new JLabel();
        selectPriceLabel = new JLabel();
        minPriceTextField = new JTextField();
        label7 = new JLabel();
        maxPriceTextField = new JTextField();
        resetButton = new JButton();
        goodInfoScrollPane = new JScrollPane();
        goodInfoTable = new JTable();
        menuBar = new JMenuBar();
        selfMenu = new JMenu();
        menuItem1 = new JMenuItem();
        menuItem2 = new JMenuItem();
        menuItem6 = new JMenuItem();
        helpMenu = new JMenu();
        menuItem3 = new JMenuItem();
        menuItem4 = new JMenuItem();
        masterMenu = new JMenu();
        menuItem5 = new JMenuItem();
        menuItem7 = new JMenuItem();

        //======== this ========
        setResizable(false);
        Container contentPane = getContentPane();
        contentPane.setLayout(null);

        //======== panel2 ========
        {
            panel2.setLayout(new BorderLayout());

            //======== selectPanel ========
            {
                selectPanel.setPreferredSize(new Dimension(450, 115));
                selectPanel.setLayout(new FlowLayout(FlowLayout.CENTER, 10, 10));

                //---- label10 ----
                label10.setText("      ");
                selectPanel.add(label10);

                //---- selectLabel ----
                selectLabel.setText("\u8f93\u5165\u641c\u7d22\u5185\u5bb9\uff1a");
                selectPanel.add(selectLabel);

                //---- selectTextField ----
                selectTextField.setPreferredSize(new Dimension(200, 30));
                selectPanel.add(selectTextField);

                //---- selectComboBox ----
                selectComboBox.setModel(new DefaultComboBoxModel<>(new String[]{
                        "\u5546\u54c1\u540d",
                        "\u5356\u5bb6",
                        "\u5546\u54c1ID"
                }));
                selectPanel.add(selectComboBox);

                //---- selectButton ----
                selectButton.setText("\u641c\u7d22");
                selectPanel.add(selectButton);

                //---- label9 ----
                label9.setText(" ");
                selectPanel.add(label9);

                //---- label8 ----
                label8.setText("          ");
                label8.setPreferredSize(new Dimension(550, 5));
                selectPanel.add(label8);
                selectPanel.add(label1);

                //---- selectTimeLabel ----
                selectTimeLabel.setText("     \u4e0a\u67b6\u65f6\u95f4\uff1a");
                selectPanel.add(selectTimeLabel);

                //---- selectTimeComboBox ----
                selectTimeComboBox.setModel(new DefaultComboBoxModel<>(new String[]{
                        " ",
                        "\u4e00\u5929\u5185",
                        "\u4e00\u5468\u5185",
                        "30\u5929\u5185"
                }));
                selectPanel.add(selectTimeComboBox);

                //---- label11 ----
                label11.setText("      ");
                selectPanel.add(label11);

                //---- selectPriceLabel ----
                selectPriceLabel.setText("\u4ef7\u683c\uff1a");
                selectPanel.add(selectPriceLabel);
                selectPanel.add(minPriceTextField);

                //---- label7 ----
                label7.setText("\u2014");
                selectPanel.add(label7);
                selectPanel.add(maxPriceTextField);

                //---- resetButton ----
                resetButton.setText("\u91cd\u7f6e");
                selectPanel.add(resetButton);
            }
            panel2.add(selectPanel, BorderLayout.PAGE_START);

            //======== goodInfoScrollPane ========
            {

                //---- goodInfoTable ----
                goodInfoTable.setModel(new DefaultTableModel(
                        new Object[][]{
                                {null, null, null, null, null},
                                {null, null, null, null, null},
                                {null, null, null, null, null},
                                {null, null, null, null, null},
                                {null, null, null, null, null},
                                {null, null, null, null, null},
                                {null, null, null, null, null},
                                {null, null, null, null, null},
                                {null, null, null, null, null},
                                {null, null, null, null, null},
                                {null, null, null, null, null},
                                {null, null, null, null, null},
                                {null, null, null, null, null},
                                {null, null, null, null, null},
                                {null, null, null, null, null},
                                {null, null, null, null, null},
                                {null, null, null, null, null},
                                {null, null, null, null, null},
                                {null, null, null, null, null},
                                {null, null, null, null, null},
                                {null, null, null, null, null},
                                {null, null, null, null, null},
                                {null, null, null, null, null},
                                {null, null, null, null, null},
                                {null, null, null, null, null},
                                {null, null, null, null, null},
                                {null, null, null, null, null},
                        },
                        new String[]{
                                "\u5546\u54c1ID", "\u5546\u54c1\u540d", "\u5546\u54c1\u6570\u91cf", "\u5546\u54c1\u4ef7\u683c", "\u5356\u5bb6"
                        }
                ) {
                    Class<?>[] columnTypes = new Class<?>[]{
                            String.class, Object.class, Integer.class, Double.class, String.class
                    };

                    @Override
                    public Class<?> getColumnClass(int columnIndex) {
                        return columnTypes[columnIndex];
                    }
                });
                goodInfoTable.setPreferredSize(null);
                goodInfoTable.setPreferredScrollableViewportSize(new Dimension(450, 300));
                goodInfoTable.addMouseListener(new MouseAdapter() {
                    @Override
                    public void mouseClicked(MouseEvent e) {
                        table1MouseClicked(e);
                    }
                });
                goodInfoScrollPane.setViewportView(goodInfoTable);
            }
            panel2.add(goodInfoScrollPane, BorderLayout.CENTER);
        }
        contentPane.add(panel2);
        panel2.setBounds(0, 22, 605, 400);

        //======== menuBar ========
        {

            //======== selfMenu ========
            {
                selfMenu.setText("\u6211\u7684");

                //---- menuItem1 ----
                menuItem1.setText("\u4e2a\u4eba\u4fe1\u606f\u7ba1\u7406>");
                selfMenu.add(menuItem1);

                //---- menuItem2 ----
                menuItem2.setText("\u4e2a\u4eba\u5546\u54c1\u7ba1\u7406>");
                selfMenu.add(menuItem2);

                //---- menuItem6 ----
                menuItem6.setText("\u5546\u54c1\u6d4f\u89c8>");
                menuItem6.setEnabled(false);
                selfMenu.add(menuItem6);
            }
            menuBar.add(selfMenu);

            //======== helpMenu ========
            {
                helpMenu.setText("\u5e2e\u52a9");

                //---- menuItem3 ----
                menuItem3.setText("\u83b7\u53d6\u66f4\u65b0");
                helpMenu.add(menuItem3);

                //---- menuItem4 ----
                menuItem4.setText("\u4f7f\u7528\u8bf4\u660e");
                helpMenu.add(menuItem4);
            }
            menuBar.add(helpMenu);

            //======== masterMenu ========
            {
                masterMenu.setText("\u7ba1\u7406");

                //---- menuItem5 ----
                menuItem5.setText("\u524d\u5f80\u7ba1\u7406\u5458\u754c\u9762>");
                masterMenu.add(menuItem5);

                //---- menuItem7 ----
                menuItem7.setText("\u524d\u5f80\u7528\u6237\u754c\u9762>");
                masterMenu.add(menuItem7);
            }
            menuBar.add(masterMenu);
        }
        contentPane.add(menuBar);
        menuBar.setBounds(0, 0, 803, menuBar.getPreferredSize().height);

        {
            // compute preferred size
            Dimension preferredSize = new Dimension();
            for (int i = 0; i < contentPane.getComponentCount(); i++) {
                Rectangle bounds = contentPane.getComponent(i).getBounds();
                preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width);
                preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height);
            }
            Insets insets = contentPane.getInsets();
            preferredSize.width += insets.right;
            preferredSize.height += insets.bottom;
            contentPane.setMinimumSize(preferredSize);
            contentPane.setPreferredSize(preferredSize);
        }
        setSize(620, 460);
        setLocationRelativeTo(getOwner());
        // JFormDesigner - End of component initialization  //GEN-END:initComponents  @formatter:on
    }
    // JFormDesigner - End of variables declaration  //GEN-END:variables  @formatter:on
}
